package test;

public class HW5 {
}
class X{
    Y y=new Y();//父类的实例代码块
    public X(){//父类的构造代码块
        System.out.print("X");
    }
}
class Y{
    public Y(){//3
        System.out.print("Y");
    }
}
class Z extends X{
    Y y=new Y();//子类的实例
    public Z(){//子类的构造代码块
        System.out.print("Z");
    }
    public static void main(String[] args) {
        new Z();
    }
}